Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Bit numbering</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Bit_numbering"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.math.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Bit_numbering rootpage-Bit_numbering skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Bit numbering</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<p>In <a href="Computing" title="Computing">computing</a>, <b>bit numbering</b> is the convention used to identify the <a href="Bit" title="Bit">bit</a> positions in a <a href="Binary_numeral_system" class="mw-redirect" title="Binary numeral system">binary number</a>.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Bit_significance_and_indexing">Bit significance and indexing</h2></div>
<table class="wikitable float-right" border="1" style="text-align:right; font-size: xx-small;">

<tbody><tr>
<td style="width:7.7em; text-align:center;"><b>150<sub>dec</sub></b></td>
<td style="width:2.4em; background:#D9DBFF; border-right: hidden;">MSb</td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em;background:#FFFFB0;">LSb
</td></tr>
<tr>
<td>Bit Content</td>
<td style="text-align:center; background:#D9DBFF;">1</td>
<td style="text-align:center;">0</td>
<td style="text-align:center;">0</td>
<td style="text-align:center;">1</td>
<td style="text-align:center;">0</td>
<td style="text-align:center;">1</td>
<td style="text-align:center;">1</td>
<td style="text-align:center;background:#FFFFB0">0
</td></tr></tbody></table>
<p>
In <a href="Computing" title="Computing">computing</a>, the <b>least significant bit</b> (<b>LSb</b>) is the <a href="Bit" title="Bit">bit</a> position in a <a href="Binary_numeral_system" class="mw-redirect" title="Binary numeral system">binary</a> <a href="Integer_(computer_science)" title="Integer (computer science)">integer</a> representing the lowest-order place of the integer. Similarly, the <b>most significant bit</b> (<b>MSb</b>) represents the highest-order place of the binary integer. The LSb is sometimes referred to as the <i>low-order bit</i>. Due to the convention in <a href="Positional_notation" title="Positional notation">positional notation</a> of writing less significant digits further to the right, the LSb also might be referred to as the <i>right-most bit</i>. The MSb is similarly referred to as the <i>high-order bit</i> or <i>left-most bit</i>. In both cases, the LSb and MSb correlate directly to the least significant <a href="Numerical_digit" title="Numerical digit">digit</a> and most significant digit of a <a href="Decimal" title="Decimal">decimal</a> integer.
</p><p>Bit indexing correlates to the positional notation of the value in base 2. For this reason, bit index is not affected by how the value is stored on the device, such as the value's <a href="Endianness" title="Endianness">byte order</a>. Rather, it is a property of the numeric value in binary itself. This is often utilized in programming via <a href="Bitwise_operation#Bit_shifts" title="Bitwise operation">bit shifting</a>: A value of <code>1 &lt;&lt; <i>n</i></code> corresponds to the <i>n</i><sup>th</sup> bit of a binary integer (with a value of <code>2<sup>n</sup></code>).
</p>
<div class="mw-heading mw-heading3"><h3 id="Least_significant_bit_in_digital_steganography">Least significant bit in digital steganography</h3></div>
<p>In digital <a href="Steganography" title="Steganography">steganography</a>, sensitive messages may be concealed by manipulating and storing information in the least significant bits of an image or a sound file. The user may later recover this information by extracting the least significant bits of the manipulated pixels to recover the original message. This allows the storage or transfer of digital information to remain concealed.
</p><p><span typeof="mw:File"></span>
</p><p>A diagram showing how manipulating the least significant bits of a color can have a very subtle and generally unnoticeable effect on the color. In this diagram, green is represented by its <a href="RGB" class="mw-redirect" title="RGB">RGB</a> value, both in decimal and in binary. The red box surrounding the last two bits illustrates the least significant bits changed in the binary representation.
</p>
<div class="mw-heading mw-heading2"><h2 id="Unsigned_integer_example">Unsigned integer example</h2></div>
<p>This table illustrates an example of decimal value of 149 and the location of LSb. In this particular example, the position of unit value (decimal 1 or 0) is located in bit position 0 (n = 0). MSb stands for <i>most significant bit</i>, while LSb stands for <i>least significant bit</i>.
</p>
<table class="wikitable float-right" border="1" style="text-align:right; font-size: xx-small;">

<tbody><tr>
<td style="width:7.7em; text-align:center;"><b>149<sub>dec</sub> in LSb<sub>0</sub></b></td>
<td style="width:2.4em; border-right: hidden;">MSb</td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em;">LSb
</td></tr>
<tr>
<td>Bit Weight</td>
<td style="background:#FFFFB0"><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{7}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>7</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{7}}</annotation>
</semantics>
</math></span><img src="./ef25b4e3395a4475684297f80e210b5f65b0e09a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.217ex; height:2.676ex;" alt="{\displaystyle 2^{7}}" loading="lazy"></span><br>128</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{6}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>6</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{6}}</annotation>
</semantics>
</math></span><img src="./558cc35d3c67659a7ed35080c5ae9cf1c8446a1c.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.217ex; height:2.676ex;" alt="{\displaystyle 2^{6}}" loading="lazy"></span><br>64</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{5}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>5</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{5}}</annotation>
</semantics>
</math></span><img src="./37fde9e05093069bd6b0dd86600a77ccf642eb36.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.217ex; height:2.676ex;" alt="{\displaystyle 2^{5}}" loading="lazy"></span><br>32</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{4}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>4</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{4}}</annotation>
</semantics>
</math></span><img src="./8071cc0bacaea4d94c5938e5b77147ed3855d059.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.217ex; height:2.676ex;" alt="{\displaystyle 2^{4}}" loading="lazy"></span><br>16</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{3}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>3</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{3}}</annotation>
</semantics>
</math></span><img src="./52e9f8299773e9205d2055998f3c8eb9441877fc.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.217ex; height:2.676ex;" alt="{\displaystyle 2^{3}}" loading="lazy"></span><br>8</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{2}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{2}}</annotation>
</semantics>
</math></span><img src="./efd7711cd907a2d46557a410fb67fc0d84c52ba3.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.217ex; height:2.676ex;" alt="{\displaystyle 2^{2}}" loading="lazy"></span><br>4</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{1}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{1}}</annotation>
</semantics>
</math></span><img src="./f990b8febae3ab32d873486ee5c343e8db92ceca.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.217ex; height:2.676ex;" alt="{\displaystyle 2^{1}}" loading="lazy"></span><br>2</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{0}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{0}}</annotation>
</semantics>
</math></span><img src="./a75edddb13f7181972ba01302b2eb0d09ebcf24d.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.217ex; height:2.676ex;" alt="{\displaystyle 2^{0}}" loading="lazy"></span><br>1
</td></tr>
<tr>
<td>Bit Content</td>
<td style="text-align:center;">1</td>
<td style="text-align:center;">0</td>
<td style="text-align:center;">0</td>
<td style="text-align:center;">1</td>
<td style="text-align:center;">0</td>
<td style="text-align:center;">1</td>
<td style="text-align:center;">0</td>
<td style="text-align:center">1
</td></tr></tbody></table>
<div class="mw-heading mw-heading2"><h2 id="Signed_integer_example">Signed integer example</h2></div>
<p>This table illustrates an example of an 8 bit signed decimal value using the <a href="Two's_complement" title="Two's complement">two's complement</a> method. The MSb <i>most significant bit</i> has a negative weight in signed integers, in this case −2<sup>7</sup> = −128. The other bits have positive weights. The lsb (<i>least significant bit</i>) has weight 1. The signed value is in this case −128+2 = −126.
</p>
<table class="wikitable float-right" border="1" style="text-align:right; font-size: xx-small;">

<tbody><tr>
<td style="width:7.7em; text-align:center;"><b>-126<sub>dec</sub> in LSb<sub>0</sub></b></td>
<td style="width:2.4em; border-right: hidden;">MSb</td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em;">LSb
</td></tr>
<tr>
<td>Bit Weight</td>
<td style="background:#FFFFB0"><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle -2^{7}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo>−<!-- − --></mo>
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>7</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle -2^{7}}</annotation>
</semantics>
</math></span><img src="./8cab4667650058691c8e001f4205d744265d93c8.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:4.025ex; height:2.843ex;" alt="{\displaystyle -2^{7}}" loading="lazy"></span><br>−128</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{6}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>6</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{6}}</annotation>
</semantics>
</math></span><img src="./558cc35d3c67659a7ed35080c5ae9cf1c8446a1c.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.217ex; height:2.676ex;" alt="{\displaystyle 2^{6}}" loading="lazy"></span><br>64</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{5}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>5</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{5}}</annotation>
</semantics>
</math></span><img src="./37fde9e05093069bd6b0dd86600a77ccf642eb36.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.217ex; height:2.676ex;" alt="{\displaystyle 2^{5}}" loading="lazy"></span><br>32</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{4}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>4</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{4}}</annotation>
</semantics>
</math></span><img src="./8071cc0bacaea4d94c5938e5b77147ed3855d059.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.217ex; height:2.676ex;" alt="{\displaystyle 2^{4}}" loading="lazy"></span><br>16</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{3}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>3</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{3}}</annotation>
</semantics>
</math></span><img src="./52e9f8299773e9205d2055998f3c8eb9441877fc.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.217ex; height:2.676ex;" alt="{\displaystyle 2^{3}}" loading="lazy"></span><br>8</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{2}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{2}}</annotation>
</semantics>
</math></span><img src="./efd7711cd907a2d46557a410fb67fc0d84c52ba3.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.217ex; height:2.676ex;" alt="{\displaystyle 2^{2}}" loading="lazy"></span><br>4</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{1}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{1}}</annotation>
</semantics>
</math></span><img src="./f990b8febae3ab32d873486ee5c343e8db92ceca.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.217ex; height:2.676ex;" alt="{\displaystyle 2^{1}}" loading="lazy"></span><br>2</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{0}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{0}}</annotation>
</semantics>
</math></span><img src="./a75edddb13f7181972ba01302b2eb0d09ebcf24d.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.217ex; height:2.676ex;" alt="{\displaystyle 2^{0}}" loading="lazy"></span><br>1
</td></tr>
<tr>
<td>Bit Content</td>
<td style="text-align:center;">1</td>
<td style="text-align:center;">0</td>
<td style="text-align:center;">0</td>
<td style="text-align:center;">0</td>
<td style="text-align:center;">0</td>
<td style="text-align:center;">0</td>
<td style="text-align:center;">1</td>
<td style="text-align:center">0
</td></tr></tbody></table>
<div class="mw-heading mw-heading2"><h2 id="Most-_vs_least-significant_bit_first">Most- vs least-significant bit first</h2></div>
<p>The expressions <i>most significant bit first</i> and <i>least significant bit at first</i> are indications on the ordering of the sequence of the bits in the bytes sent over a wire in a <a href="Serial_transmission" class="mw-redirect" title="Serial transmission">serial transmission</a> protocol or in a stream (e.g. an audio stream).
</p><p><i>Most significant bit first</i> means that the most significant bit will arrive first: hence e.g. the hexadecimal number <code>0x12</code>, <code>00010010</code> in binary representation, will arrive as the sequence <code>0 0 0 1 0 0 1 0</code> .
</p><p><i>Least significant bit first</i> means that the least significant bit will arrive first: hence e.g. the same hexadecimal number <code>0x12</code>, again <code>00010010</code> in binary representation, will arrive as the (reversed) sequence <code>0 1 0 0 1 0 0 0</code>.
</p>
<div class="mw-heading mw-heading2"><h2 id="LSb_0_bit_numbering">LSb 0 bit numbering</h2></div>
<table class="wikitable float-right" border="1" style="text-align:right; font-size: xx-small;">

<tbody><tr>
<td style="width:7.7em; text-align:center;"><b>150<sub>dec</sub> in LSb<sub>0</sub></b></td>
<td style="width:2.4em; background:#D9DBFF; border-right: hidden;">MSb</td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em;background:#FFFFB0;">LSb
</td></tr>
<tr>
<td>Bit Number</td>
<td style="border-right: hidden;">7</td>
<td style="border-right: hidden;"></td>
<td style="border-right: hidden;"></td>
<td style="border-right: hidden;"></td>
<td style="border-right: hidden;"></td>
<td style="border-right: hidden;"></td>
<td style="border-right: hidden;"></td>
<td style="background:#FFFFB0;">0
</td></tr>
<tr>
<td>Bit Weight</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{7}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>7</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{7}}</annotation>
</semantics>
</math></span><img src="./ef25b4e3395a4475684297f80e210b5f65b0e09a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.217ex; height:2.676ex;" alt="{\displaystyle 2^{7}}" loading="lazy"></span><br>128</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{6}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>6</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{6}}</annotation>
</semantics>
</math></span><img src="./558cc35d3c67659a7ed35080c5ae9cf1c8446a1c.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.217ex; height:2.676ex;" alt="{\displaystyle 2^{6}}" loading="lazy"></span><br>64</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{5}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>5</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{5}}</annotation>
</semantics>
</math></span><img src="./37fde9e05093069bd6b0dd86600a77ccf642eb36.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.217ex; height:2.676ex;" alt="{\displaystyle 2^{5}}" loading="lazy"></span><br>32</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{4}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>4</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{4}}</annotation>
</semantics>
</math></span><img src="./8071cc0bacaea4d94c5938e5b77147ed3855d059.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.217ex; height:2.676ex;" alt="{\displaystyle 2^{4}}" loading="lazy"></span><br>16</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{3}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>3</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{3}}</annotation>
</semantics>
</math></span><img src="./52e9f8299773e9205d2055998f3c8eb9441877fc.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.217ex; height:2.676ex;" alt="{\displaystyle 2^{3}}" loading="lazy"></span><br>8</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{2}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{2}}</annotation>
</semantics>
</math></span><img src="./efd7711cd907a2d46557a410fb67fc0d84c52ba3.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.217ex; height:2.676ex;" alt="{\displaystyle 2^{2}}" loading="lazy"></span><br>4</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{1}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{1}}</annotation>
</semantics>
</math></span><img src="./f990b8febae3ab32d873486ee5c343e8db92ceca.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.217ex; height:2.676ex;" alt="{\displaystyle 2^{1}}" loading="lazy"></span><br>2</td>
<td style="background:#FFFFB0"><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{0}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{0}}</annotation>
</semantics>
</math></span><img src="./a75edddb13f7181972ba01302b2eb0d09ebcf24d.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.217ex; height:2.676ex;" alt="{\displaystyle 2^{0}}" loading="lazy"></span><br>1
</td></tr>
<tr>
<td>Bit Content</td>
<td style="text-align:center;">1</td>
<td style="text-align:center;">0</td>
<td style="text-align:center;">0</td>
<td style="text-align:center;">1</td>
<td style="text-align:center;">0</td>
<td style="text-align:center;">1</td>
<td style="text-align:center;">1</td>
<td style="text-align:center;background:#FFFFB0">0
</td></tr></tbody></table>
<p>When the bit numbering starts at zero for the least significant bit (LSb) the numbering scheme is called <i>LSb&nbsp;0</i>.<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> This bit numbering method has the advantage that for any <a href="Unsigned_number" class="mw-redirect" title="Unsigned number">unsigned number</a> the value of the number can be calculated by using <a href="Positional_notation#Exponentiation" title="Positional notation">exponentiation</a> with the bit number and a <a href="Radix" title="Radix">base</a> of&nbsp;2.<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> The value of an unsigned binary <a href="Integer_(computer_science)" title="Integer (computer science)">integer</a> is therefore
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \sum _{i=0}^{N-1}b_{i}\cdot 2^{i}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<munderover>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
<mo>=</mo>
<mn>0</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>N</mi>
<mo>−<!-- − --></mo>
<mn>1</mn>
</mrow>
</munderover>
<msub>
<mi>b</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
</msub>
<mo>⋅<!-- ⋅ --></mo>
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \sum _{i=0}^{N-1}b_{i}\cdot 2^{i}}</annotation>
</semantics>
</math></span><img src="./2aa39aecbb502de554234d93de172b28ee1bc14e.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.005ex; width:9.385ex; height:7.343ex;" alt="{\displaystyle \sum _{i=0}^{N-1}b_{i}\cdot 2^{i}}" loading="lazy"></span></dd></dl>
<p>where <i>b<sub>i</sub></i> denotes the value of the bit with number <i>i</i>, and <i>N</i> denotes the number of bits in total.
</p>
<div class="mw-heading mw-heading2"><h2 id="MSb_0_bit_numbering">MSb 0 bit numbering</h2></div>
<table class="wikitable float-right" border="1" style="text-align:right; font-size: xx-small;">

<tbody><tr>
<td style="width:7.7em; text-align:center;"><b>150<sub>dev</sub> in MSb<sub>0</sub></b></td>
<td style="width:2.4em; background:#D9DBFF; border-right: hidden;">MSb</td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em; border-right: hidden;"></td>
<td style="width:2.4em;background:#FFFFB0;">LSb
</td></tr>
<tr>
<td>Bit Number</td>
<td style="background:#D9DBFF; border-right: hidden;">0</td>
<td style="border-right: hidden;"></td>
<td style="border-right: hidden;"></td>
<td style="border-right: hidden;"></td>
<td style="border-right: hidden;"></td>
<td style="border-right: hidden;"></td>
<td style="border-right: hidden;"></td>
<td>7
</td></tr>
<tr>
<td>Bit Weight</td>
<td style="background:#D9DBFF"><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{7-0}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>7</mn>
<mo>−<!-- − --></mo>
<mn>0</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{7-0}}</annotation>
</semantics>
</math></span><img src="./cfd470bfaa66c39c31945a45c2270b1ad1ac3cf7.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:4.317ex; height:2.676ex;" alt="{\displaystyle 2^{7-0}}" loading="lazy"></span><br>128</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{7-1}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>7</mn>
<mo>−<!-- − --></mo>
<mn>1</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{7-1}}</annotation>
</semantics>
</math></span><img src="./d84be8f8a8e902f2d92494d90fd39691050b354f.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:4.317ex; height:2.676ex;" alt="{\displaystyle 2^{7-1}}" loading="lazy"></span><br>64</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{7-2}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>7</mn>
<mo>−<!-- − --></mo>
<mn>2</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{7-2}}</annotation>
</semantics>
</math></span><img src="./d7d2592296dc441be3283ac655a854fe6907dd31.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:4.317ex; height:2.676ex;" alt="{\displaystyle 2^{7-2}}" loading="lazy"></span><br>32</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{7-3}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>7</mn>
<mo>−<!-- − --></mo>
<mn>3</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{7-3}}</annotation>
</semantics>
</math></span><img src="./5456ac3817f0d5456e0157c1aea2088a4766649c.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:4.317ex; height:2.676ex;" alt="{\displaystyle 2^{7-3}}" loading="lazy"></span><br>16</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{7-4}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>7</mn>
<mo>−<!-- − --></mo>
<mn>4</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{7-4}}</annotation>
</semantics>
</math></span><img src="./5f4624c932b23d0ea21f7b09218d820e1b6bdb24.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:4.317ex; height:2.676ex;" alt="{\displaystyle 2^{7-4}}" loading="lazy"></span><br>8</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{7-5}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>7</mn>
<mo>−<!-- − --></mo>
<mn>5</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{7-5}}</annotation>
</semantics>
</math></span><img src="./6b6346646a8c0442675ba377baf836b873fc6d0a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:4.317ex; height:2.676ex;" alt="{\displaystyle 2^{7-5}}" loading="lazy"></span><br>4</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{7-6}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>7</mn>
<mo>−<!-- − --></mo>
<mn>6</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{7-6}}</annotation>
</semantics>
</math></span><img src="./4c73045dd8863d1f56a9cd1cd56ab4ea1feca464.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:4.317ex; height:2.676ex;" alt="{\displaystyle 2^{7-6}}" loading="lazy"></span><br>2</td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2^{7-7}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>7</mn>
<mo>−<!-- − --></mo>
<mn>7</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 2^{7-7}}</annotation>
</semantics>
</math></span><img src="./ddb2f0c3a71d168637e3a19436a6c275b5de3006.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:4.317ex; height:2.676ex;" alt="{\displaystyle 2^{7-7}}" loading="lazy"></span><br>1
</td></tr>
<tr>
<td>Bit Content</td>
<td style="text-align:center;background:#D9DBFF;">1</td>
<td style="text-align:center;">0</td>
<td style="text-align:center;">0</td>
<td style="text-align:center;">1</td>
<td style="text-align:center;">0</td>
<td style="text-align:center;">1</td>
<td style="text-align:center;">1</td>
<td style="text-align:center;">0
</td></tr></tbody></table>
<p>When the bit numbering starts at zero for the most significant bit (MSb) the numbering scheme is called <i>MSb&nbsp;0</i>.
</p><p>The value of an unsigned binary integer is therefore
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \sum _{i=0}^{N-1}b_{i}\cdot 2^{N-1-i}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<munderover>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
<mo>=</mo>
<mn>0</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>N</mi>
<mo>−<!-- − --></mo>
<mn>1</mn>
</mrow>
</munderover>
<msub>
<mi>b</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
</msub>
<mo>⋅<!-- ⋅ --></mo>
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mi>N</mi>
<mo>−<!-- − --></mo>
<mn>1</mn>
<mo>−<!-- − --></mo>
<mi>i</mi>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \sum _{i=0}^{N-1}b_{i}\cdot 2^{N-1-i}}</annotation>
</semantics>
</math></span><img src="./28e896aedf140c0a2fb298c3836906b85014cc60.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.005ex; width:14.224ex; height:7.343ex;" alt="{\displaystyle \sum _{i=0}^{N-1}b_{i}\cdot 2^{N-1-i}}" loading="lazy"></span></dd></dl>
<div class="mw-heading mw-heading2"><h2 id="LSb_calculation">LSb calculation</h2></div>
<p>LSb of a number can be calculated with time complexity of <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle O(n)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>O</mi>
<mo stretchy="false">(</mo>
<mi>n</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle O(n)}</annotation>
</semantics>
</math></span><img src="./34109fe397fdcff370079185bfdb65826cb5565a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:4.977ex; height:2.843ex;" alt="{\displaystyle O(n)}" loading="lazy"></span> with formula <code>a &amp; (~ a+1)</code>, where <code>&amp;</code> means <a href="Binary_AND" class="mw-redirect" title="Binary AND">binary AND</a> and <code>~</code> means <a href="Binary_NOT" class="mw-redirect" title="Binary NOT">binary NOT</a>.
</p>
<div class="mw-heading mw-heading2"><h2 id="Other">Other</h2></div>
<p>For MSb 1 numbering, the value of an unsigned binary integer is
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \sum _{i=1}^{N}b_{i}\cdot 2^{N-i}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<munderover>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>N</mi>
</mrow>
</munderover>
<msub>
<mi>b</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
</msub>
<mo>⋅<!-- ⋅ --></mo>
<msup>
<mn>2</mn>
<mrow class="MJX-TeXAtom-ORD">
<mi>N</mi>
<mo>−<!-- − --></mo>
<mi>i</mi>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \sum _{i=1}^{N}b_{i}\cdot 2^{N-i}}</annotation>
</semantics>
</math></span><img src="./ab3f7b09bcf1fb33aad1d3d17a7a3de716b2597c.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.005ex; width:11.918ex; height:7.343ex;" alt="{\displaystyle \sum _{i=1}^{N}b_{i}\cdot 2^{N-i}}" loading="lazy"></span></dd></dl>
<p><a href="PL/I" title="PL/I">PL/I</a> numbers <var style="padding-right: 1px;">BIT</var> strings starting with 1 for the leftmost bit.
</p><p>The <a href="Fortran" title="Fortran">Fortran</a> <var style="padding-right: 1px;">BTEST</var> function uses LSb&nbsp;0 numbering.
</p>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="ARINC_429" title="ARINC 429">ARINC 429</a></li>
<li><a href="Binary_numeral_system" class="mw-redirect" title="Binary numeral system">Binary numeral system</a></li>
<li><a href="Signed_number_representations" title="Signed number representations">Signed number representations</a></li>
<li><a href="Two's_complement" title="Two's complement">Two's complement</a></li>
<li><a href="Endianness" title="Endianness">Endianness</a></li>
<li><a href="Binary_logarithm" title="Binary logarithm">Binary logarithm</a></li>
<li><a href="Unit_in_the_last_place" title="Unit in the last place">Unit in the last place</a> (ULP)</li>
<li><a href="Find_first_set" title="Find first set">Find first set</a></li>
<li><a href="MAC_address#Bit-reversed_notation" title="MAC address">MAC address: Bit-reversed notation</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */


.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}


/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */


.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}


/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFLangdon,_Glen_G.1982" class="citation book cs1">Langdon, Glen G. (1982). <span class="id-lock-registration" title="Free registration required"><a rel="nofollow" class="external text" href="https://archive.org/details/computerdesign00lang/page/52"><i>Computer Design</i></a></span>. Computeach Press Inc. p.&nbsp;<a rel="nofollow" class="external text" href="https://archive.org/details/computerdesign00lang/page/52">52</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>0-9607864-0-6</bdi>.</cite></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://www.xcprod.com/titan/XCSB-DOC/bit_numbers.html">"Bit Numbers"</a><span class="reference-accessdate">. Retrieved <span class="nowrap">2021-03-30</span></span>.</cite></span>
</li>
</ol></div></div></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-07-24" href="https://en.wikipedia.org/wiki/?title=Bit_numbering&amp;oldid=1302318757">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>

</body></html>